package com.qdxht.dispenser.ui.activity.test;

import android.content.Context;
import android.util.AttributeSet;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

public class MyVideoPlayer extends StandardGSYVideoPlayer {
    
    public MyVideoPlayer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void changeUiToPreparingShow() {
        super.changeUiToPreparingShow();
        hide();
    }

    @Override
    public void changeUiToPauseShow() {
        super.changeUiToPauseShow();
        hide();
    }

    @Override
    public void changeUiToError() {
        super.changeUiToError();
        hide();
    }

    @Override
    public void changeUiToCompleteShow() {
        super.changeUiToCompleteShow();
        hide();
    }

    @Override
    public void changeUiToPlayingBufferingShow() {
        super.changeUiToPlayingBufferingShow();
        hide();
    }

    @Override
    public void changeUiToPrepareingClear() {
        super.changeUiToPrepareingClear();
        hide();
    }

    @Override
    public void changeUiToPlayingClear() {
        super.changeUiToPlayingClear();
        hide();
    }

    @Override
    public void changeUiToPauseClear() {
        super.changeUiToPauseClear();
        hide();
    }

    @Override
    public void changeUiToPlayingBufferingClear() {
        super.changeUiToPlayingBufferingClear();
        hide();
    }

    @Override
    public void changeUiToClear() {
        super.changeUiToClear();
        hide();
    }

    @Override
    public void changeUiToCompleteClear() {
        super.changeUiToCompleteClear();
        hide();
    }

    @Override
    public void changeUiToPlayingShow() {
        super.changeUiToPlayingShow();
        hide();
    }

    @Override
    public void changeUiToNormal() {
        super.changeUiToNormal();
        hide();
    }

    private void hide() {
        setViewShowState(mTopContainer, INVISIBLE);
        setViewShowState(mBottomContainer, INVISIBLE);
        setViewShowState(mStartButton, INVISIBLE);
        setViewShowState(mLoadingProgressBar, INVISIBLE);
        setViewShowState(mThumbImageViewLayout, INVISIBLE);
        setViewShowState(mBottomProgressBar, INVISIBLE);
        setViewShowState(mLockScreen, GONE);
    }

    @Override
    public void onVideoPause() {
        super.onVideoPause();
        mPauseBeforePrepared = false; // 是否准备完成前调用了暂停，避免再次暂停
    }

    @Override
    public void touchDoubleUp() {
        // 双击会暂停，重载清除
    }
} 